<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>栅格系统</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }

        main{
            width: 100vw;
            height: 100vh;
            display: grid;
            grid-template-rows: 50% 50%;
            /*grid-template-columns: 20% 20% 20% 20% 20%;*/
            /*// 最少最大的宽度范围*/
            grid-template-columns: repeat(auto-fit,minmax(320px, 1fr));
        }

        div{
            background-color: pink;
            border: 1px solid black;
            /*padding: -30px;*/
            /*background-clip: content-box;*/
        }

    </style>
</head>
<body>

<main>
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
    <div>7</div>
    <div>8</div>
    <div>9</div>
    <div>10</div>
</main>
</body>
</html>
